From 7af89b565e3efedde957f665c244f78593515c0f Mon Sep 17 00:00:00 2001 From: "cl349@arcadians.cl.cam.ac.uk" Date: Thu, 16 Dec 2004 15:04:02 +0000 Subject: [PATCH] bitkeeper revision 1.1159.1.484 (41c1a3e20WEWxhNQDQK6avGv36pVEA) Remove per vcpu misdirect virq support. --- .../arch/xen/i386/kernel/smpboot.c | 2 -- xen/common/domain.c | 3 -- xen/common/event_channel.c | 34 +++++-------------- xen/include/xen/event.h | 7 +++- 4 files changed, 14 insertions(+), 32 deletions(-) diff --git a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c index 1a80279c29..a9bb0e201b 100644 --- a/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c +++ b/linux-2.6.9-xen-sparse/arch/xen/i386/kernel/smpboot.c @@ -458,7 +458,6 @@ void local_setup_debug(void) } -extern void setup_misdirect_virq(void); extern void local_setup_timer(void); /* @@ -475,7 +474,6 @@ int __init start_secondary(void *unused) smp_callin(); while (!cpu_isset(smp_processor_id(), smp_commenced_mask)) rep_nop(); - setup_misdirect_virq(); local_setup_timer(); local_setup_debug(); /* XXX */ smp_intr_init(); diff --git a/xen/common/domain.c b/xen/common/domain.c index 34ffb416b8..9501e3094b 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -328,9 +328,6 @@ long do_boot_vcpu(unsigned long vcpu, full_execution_context_t *ctxt) atomic_set(&ed->pausecnt, 0); shadow_lock_init(ed); - if ( (rc = init_exec_domain_event_channels(ed)) != 0 ) - goto out; - memcpy(&ed->thread, &idle0_exec_domain.thread, sizeof(ed->thread)); /* arch_do_createdomain */ diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c index 017a27dc17..bf5170c683 100644 --- a/xen/common/event_channel.c +++ b/xen/common/event_channel.c @@ -259,8 +259,7 @@ static long evtchn_bind_virq(evtchn_bind_virq_t *bind) * bound yet. The exception is the 'misdirect VIRQ', which is permanently * bound to port 0. */ - if ( ((port = ed->virq_to_evtchn[virq]) != - (ed->eid * EVENT_CHANNELS_SPREAD)) || + if ( ((port = ed->virq_to_evtchn[virq]) != 0) || (virq == VIRQ_MISDIRECT) || ((port = get_free_port(ed)) < 0) ) goto out; @@ -355,8 +354,7 @@ static long __evtchn_close(struct domain *d1, int port1) chn1 = d1->event_channel; /* NB. Port 0 is special (VIRQ_MISDIRECT). Never let it be closed. */ - if ( (port1 <= 0) || (port1 >= d1->max_event_channel) || - ((port1 & (EVENT_CHANNELS_SPREAD - 1)) == 0) ) + if ( (port1 <= 0) || (port1 >= d1->max_event_channel) ) { rc = -EINVAL; goto out; @@ -641,31 +639,15 @@ long do_event_channel_op(evtchn_op_t *uop) } -int init_exec_domain_event_channels(struct exec_domain *ed) -{ - struct domain *d = ed->domain; - int port, ret = -EINVAL, virq; - - spin_lock(&d->event_channel_lock); - port = ed->eid * EVENT_CHANNELS_SPREAD; - if ( ((port < d->max_event_channel && - d->event_channel[port].state != ECS_FREE)) || - (get_free_port(ed) != port) ) - goto out; - d->event_channel[port].state = ECS_VIRQ; - d->event_channel[port].u.virq = VIRQ_MISDIRECT; - for ( virq = 0; virq < NR_VIRQS; virq++ ) - ed->virq_to_evtchn[virq] = port; - ret = 0; - out: - spin_unlock(&d->event_channel_lock); - return ret; -} - int init_event_channels(struct domain *d) { spin_lock_init(&d->event_channel_lock); - return init_exec_domain_event_channels(d->exec_domain[0]); + /* Call get_free_port to initialize d->event_channel */ + if ( get_free_port(d->exec_domain[0]) != 0 ) + return -EINVAL; + d->event_channel[0].state = ECS_VIRQ; + d->event_channel[0].u.virq = VIRQ_MISDIRECT; + return 0; } diff --git a/xen/include/xen/event.h b/xen/include/xen/event.h index 7410c0aa8c..aa3d7092ae 100644 --- a/xen/include/xen/event.h +++ b/xen/include/xen/event.h @@ -57,7 +57,12 @@ static inline void evtchn_set_pending(struct exec_domain *ed, int port) */ static inline void send_guest_virq(struct exec_domain *ed, int virq) { - evtchn_set_pending(ed, ed->virq_to_evtchn[virq]); + int port = ed->virq_to_evtchn[virq]; + + /* Always deliver misdirect virq's to exec domain 0. */ + if ( unlikely(port == 0) ) + ed = ed->domain->exec_domain[0]; + evtchn_set_pending(ed, port); } /* -- 2.30.2